/**
 * @Author: lll
 * @Email:li.lele@vpclub.cn
 * @Date: create in 2020/6/24
 */
package cn.vpclub.admin.config;

//import cn.vpclub.admin.service.UserDetailsServiceImpl;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
//import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
//
//@Configuration
//@EnableWebSecurity
//@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true, jsr250Enabled = true)
public class WebSecurityConfig  {
//public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
//    @Bean
//    public PasswordEncoder passwordEncoder() {
//        return new BCryptPasswordEncoder();
//    }
//
//    @Autowired
//    UserDetailsServiceImpl userDetailsService;
//
//    @Override
//    protected void configure(HttpSecurity httpSecurity) throws Exception {
//        httpSecurity.authorizeRequests()
//                .antMatchers("/", "/login/**","/menu/**","/home/**","/hello/**").permitAll()
//                .antMatchers("/role1").hasRole("role1")
//                .antMatchers("/role2").hasRole("role2")
//                .antMatchers("/role3").hasRole("role3")
////                .and().formLogin().permitAll();
//                .and().formLogin().loginPage("/login").loginProcessingUrl("/login/loginSys");
////                .and()
////                .formLogin().loginPage("/login").permitAll()
////                .and()
////                .logout().permitAll();
//    }
//
//    @Override
//    protected void configure(AuthenticationManagerBuilder authenticationManagerBuilder) throws Exception {
////        authenticationManagerBuilder.inMemoryAuthentication().
////                passwordEncoder(passwordEncoder()).
////                withUser("role").password(passwordEncoder().encode("role1")).roles("role1")
////        ;
//        authenticationManagerBuilder.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
//    }

}
